# -*- coding: utf-8 -*- 


import urllib2, base64

if __name__=='__main__':
    ip='192.168.1.1'
    login_user='useradmin'
    login_pw='admin!@#$%^'
    
    url = 'http://' + ip + '/userRpm/SysRebootRpm.htm?Reboot=%D6%D8%C6%F4%C2%B7%D3%C9%C6%F7'
    auth = 'Basic ' + base64.b64encode(login_user+':'+login_pw)
    print auth
    heads = { 'Referer' : 'http://' + ip + '/userRpm/SysRebootRpm.htm',
             'Authorization' : auth
    }
    
    request = urllib2.Request(url, None, heads)
    response = urllib2.urlopen(request)
    print response.read()